var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});


// 首页请求数据接口
router.get("/slideshow", function (req, res) {
  res.json({
    list: [
      { img: "http://localhost:3000/img/1.jpg" },
      { img: "http://localhost:3000/img/2.jpg" },
      { img: "http://localhost:3000/img/3.jpg" },
      { img: "http://localhost:3000/img/4.jpg" }
    ],
    ten: [
      { title: "产品分类", img: "http://localhost:3000/img/index1.png" },
      { title: "近期新品", img: "http://localhost:3000/img/index2.png" },
      { title: "限时折扣", img: "http://localhost:3000/img/index6.png" },
      { title: "茶窝秒杀", img: "http://localhost:3000/img/index4.png" },
      { title: "值得买", img: "http://localhost:3000/img/index3.png" },
      { title: "优惠套餐", img: "http://localhost:3000/img/index5.png" },
      { title: "精选", img: "http://localhost:3000/img/index8.png" },
      { title: "买就送", img: "http://localhost:3000/img/index7.png" },
      { title: "积分兑换", img: "http://localhost:3000/img/index9.png" },
      { title: "签到有礼", img: "http://localhost:3000/img/index10.png" }
    ]


  })
})















module.exports = router;
